﻿	using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iLangl.Model;

namespace iLangl.BusinessModel.Actions
{
	public class GetWorkAreas : BaseSecurityAction
	{
		public GetWorkAreas()
			: base()
		{
			WorkareaResponseContext context = new WorkareaResponseContext();
			ResponseContext = context;
			context.ContextUpdated += new EventHandler(context_ContextUpdated);
			
		}

		void context_ContextUpdated(object sender, EventArgs e)
		{
			object result = ResponseContext.GetContext();

			if (result is List<WorkArea>)
			{
				workareas = (List<WorkArea>)result;
			}

			weGetResult();
		}

		private List<WorkArea> workareas = null;
		public List<WorkArea> Workareas
		{
			get
			{
				return workareas;
			}
		}

		protected override string GetName()
		{
			return "GetWorkAreas";
		}


		protected override string GetVersion()
		{
			return "1";
		}
	}
}
